package com.gxjc.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.gxjc.dao.bean.NodeDao;
import com.gxjc.model.Node;
@Transactional
public class NodeService {
	@Autowired
	NodeDao nodeDao;
	public List<Node> getAll(){
		return nodeDao.getAll();	
	}
	
	public void save(Node node) {
		nodeDao.save(node);
	}
	
	public void delete(int id) {
		nodeDao.delete(id);
	}
	@Transactional(propagation=Propagation.NOT_SUPPORTED,readOnly=true)
	public Node getNodeById(int id) {
		return (Node)nodeDao.getNodeById(id);
	}@Transactional(propagation=Propagation.NOT_SUPPORTED,readOnly=true)
	public List<Node> getNodeBySql(String sql) {
		return nodeDao.getNodeBySql(sql);
	}
	public void update(Node node) {
		nodeDao.update(node);
	}
	//get and set

	public NodeDao getNodeDao() {
		return nodeDao;
	}

	public void setNodeDao(NodeDao nodeDao) {
		this.nodeDao = nodeDao;
	}
	
	
}
